package com.gl.portal.system.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gl.common.util.StringUtils;

/**
 * 菜单权限VO
 */
public class SysMenuVo {
	/**
	 * 菜单ID
	 */
	private Long id;

	/**
	 * 菜单名称
	 */
	@NotBlank(message = "菜单名称不能为空")
	@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
	private String menuName;

	/**
	 * 父菜单ID
	 */
	private Long parentId;

	/**
	 * 父菜单名称
	 */
	private String parentName;

	/**
	 * 显示顺序
	 */
	@NotNull(message = "显示顺序不能为空")
	private Integer sortNum;

	/**
	 * 路由地址
	 */
	@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
	private String path;

	/**
	 * 组件路径
	 */
	@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
	private String component;

	/**
	 * 类型（1目录 2菜单 3按钮）
	 */
	@NotNull(message = "菜单类型不能为空")
	private Integer menuType;

	/**
	 * 显示状态（0显示 1隐藏）
	 */
	private Integer visible;

	/**
	 * 菜单状态（0显示 1隐藏）
	 */
	private Integer status;

	/**
	 * 权限字符串
	 */
	@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
	private String perms;

	/**
	 * 菜单图标
	 */
	private String icon;

	/**
	 * 创建人
	 */
	private String creator;

	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	/**
	 * 更新人
	 */
	private String updator;

	/**
	 * 更新时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;

	/**
	 * 子菜单
	 */
	private List<SysMenuVo> children = new ArrayList<>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public Integer getSortNum() {
		return sortNum;
	}

	public void setSortNum(Integer sortNum) {
		this.sortNum = sortNum;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getComponent() {
		return component;
	}

	public void setComponent(String component) {
		this.component = component;
	}

	public Integer getMenuType() {
		return menuType;
	}

	public void setMenuType(Integer menuType) {
		this.menuType = menuType;
	}

	public Integer getVisible() {
		return visible;
	}

	public void setVisible(Integer visible) {
		this.visible = visible;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getPerms() {
		return perms;
	}

	public void setPerms(String perms) {
		this.perms = perms;
	}

	public String getIcon() {
		return StringUtils.isBlank(icon) ? StringUtils.EMPTY : icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUpdator() {
		return updator;
	}

	public void setUpdator(String updator) {
		this.updator = updator;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public List<SysMenuVo> getChildren() {
		return children;
	}

	public void setChildren(List<SysMenuVo> children) {
		this.children = children;
	}

	@Override
	public String toString() {
		return "SysMenuVo [id=" + id + ", menuName=" + menuName + ", parentId=" + parentId + ", parentName="
				+ parentName + ", sortNum=" + sortNum + ", path=" + path + ", component=" + component + ", menuType="
				+ menuType + ", visible=" + visible + ", status=" + status + ", perms=" + perms + ", icon=" + icon
				+ ", creator=" + creator + ", createTime=" + createTime + ", updator=" + updator + ", updateTime="
				+ updateTime + "]";
	}

}
